<template>
  <div class="members-container">
    <h2>我们的团队成员</h2>
    <div class="members-grid">
      <div class="member-card" v-for="(member, index) in members" :key="index">
        <img :src="member.avatar" alt="头像" class="member-avatar" />
        <h3 class="member-name">{{ member.name }}</h3>
        <p class="member-role">{{ member.role }}</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

// 团队成员列表
const members = ref([
  {
    name: '杨镛',
    avatar: 'https://ooo.0x0.ooo/2024/12/22/OETW4a.jpg',
  },
  {
    name: '李展',
    avatar: 'https://ooo.0x0.ooo/2024/12/22/OETb2S.jpg'
  },
  {
    name: '桂俊杰',
    avatar: 'https://ooo.0x0.ooo/2024/12/22/OETxbN.jpg'
  },
  {
    name: '苏畅',
    avatar: 'https://ooo.0x0.ooo/2024/11/22/OHsKLD.jpg',
  },
]);
</script>

<style scoped>
/* 背景设置为白色 */
body {
  margin: 0;
  padding: 0;
  background-color: #ffffff; /* 设置白色背景 */
  font-family: 'Arial', sans-serif;
  color: #333; /* 设置文本颜色为深色，确保可读性 */
}

/* 容器样式 */
.members-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  min-height: 100vh;
}

/* 标题样式 */
h2 {
  font-size: 2.8rem;
  margin-bottom: 30px;
  background: linear-gradient(90deg, #f093fb, #f5576c);
  -webkit-background-clip: text;
  color: transparent;
  animation: fadeIn 1.2s ease-out;
  font-weight: bold;
}

/* 成员卡片网格布局 */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding: 20px;
}

/* 成员卡片样式 */
.member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9); /* 轻微透明背景 */
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 卡片悬停效果 */
.member-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

/* 成员头像样式 */
.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
}

.member-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.member-avatar:hover {
  transform: scale(1.05);
}

/* 成员名称样式 */
.member-name {
  font-size: 1.8rem;
  margin: 10px 0 5px;
  color: #333; /* 设置名称颜色为深色 */
  background: linear-gradient(90deg, #f093fb, #f5576c);
  -webkit-background-clip: text;
  color: transparent;
  font-weight: bold;
}

/* 成员角色样式 */
.member-role {
  font-size: 1.2rem;
  color: #666; /* 设置角色颜色为浅灰色 */
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .members-container {
    padding: 20px;
  }

  h2 {
    font-size: 2.2rem;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }
}
</style>
